package com.gsafety.wellsfort.dao.course;

import com.gsafety.wellsfort.domain.dto.course.ExamFinishPreviewDTO;
import com.gsafety.wellsfort.domain.dto.course.MyExamDTO;
import com.gsafety.wellsfort.domain.model.course.StudentExam;
import com.gsafety.wellsfort.domain.vo.IndexExamVO;
import com.gsafety.wellsfort.domain.vo.IndexQueryVO;
import com.gsafety.wellsfort.domain.vo.MyQuestionVO;
import com.gsafety.wellsfort.domain.vo.StudentExamFinishRecordVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface StudentExamDAO {
    int deleteByPrimaryKey(Integer id);

    int deleteByExamPublishId(Integer id);

    int deleteByParamMap(Map<String, Object> param);

    int insert(StudentExam record);

    int insertSelective(StudentExam record);

    StudentExam selectByPrimaryKey(Integer id);

    StudentExam examDetail(MyExamDTO myExamDTO);

    Integer countPublishNum(Integer examPublishId);

    Integer countFinishByState(@Param("studentId")Integer studentId,@Param("finishState")Integer finishState,@Param("endTime")Date endTime);

    Integer countPublishFinishNum(@Param("examPublishId")Integer workPublishId,@Param("examId")Integer workId,@Param("finishState")Integer finishState);

    List<MyQuestionVO> myExamQuestion(MyExamDTO myExamDTO);

    List<StudentExamFinishRecordVO> selectByFinishPreviewDTO(ExamFinishPreviewDTO dtoParams);

    int updateByPrimaryKeySelective(StudentExam record);

    int updateByPrimaryKey(StudentExam record);

    List<IndexExamVO> selectExamByParam(IndexQueryVO indexQueryVO);

    List<StudentExam> selectByCondition(MyExamDTO myExamDTO);

    List<StudentExam> selectByParam(StudentExam studentExam);

    int countStartTimeByRange(@Param("createdStart") Date startTime, @Param("createdEnd") Date endTime);

    List<StudentExam> getDoingWork();
}